package com.happyclub.pojo;

import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.util.Date;
import java.util.Objects;

/**
 * @author 高欢
 * @description TODO
 * @date 2019/4/4
 */
@Entity
@Table(name = "TB_ACTIVITY_TYPE", schema = "SCOTT")
@EntityListeners(AuditingEntityListener.class)
public class TbActivityType {
    private String activityTypeId;
    private String activityTypeName;
    private Date updateTime;
    private Date createTime;

    @Id
    @Column(name = "ACTIVITY_TYPE_ID")
    public String getActivityTypeId() {
        return activityTypeId;
    }

    public void setActivityTypeId(String activityTypeId) {
        this.activityTypeId = activityTypeId;
    }

    @Basic
    @Column(name = "ACTIVITY_TYPE_NAME")
    public String getActivityTypeName() {
        return activityTypeName;
    }

    public void setActivityTypeName(String activityTypeName) {
        this.activityTypeName = activityTypeName;
    }

    @Basic
    @Column(name = "UPDATE_TIME")
    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "CREATE_TIME")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TbActivityType that = (TbActivityType) o;
        return Objects.equals(activityTypeId, that.activityTypeId) &&
                Objects.equals(activityTypeName, that.activityTypeName) &&
                Objects.equals(updateTime, that.updateTime) &&
                Objects.equals(createTime, that.createTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(activityTypeId, activityTypeName, updateTime, createTime);
    }
}
